Chris Pollett > Old Classes >
CS158a

( Print View )

Student Corner:
  [Grades Sec1]
  [Grades Sec2]

  [Submit Sec1]
  [Submit Sec2]

  [Class Sign up Sec1]
  [Class Sign up Sec2]

  [
Lecture Notes]

  [Discussion Board]

  [Announcements]

Course Info:
  [Texts & Links]
  [Topics/Outcomes]
  [Outcomes Matrix]
  [Grading]
  [HW Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Additional Policies]

HW Assignments:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Hw5]

Practice Exams:
  [Mid1]  [Mid2]  [Final]

                           












HW#3 --- last modified February 28 2019 23:13:27..

Solution set.

Due date: Mar 23

Files to be submitted:
  Hw3.zip

Purpose: To become familiar with the Medium Access Control Sublayer and its protocols.

Related Course Outcomes:

(4) Describe local area network protocols including Ethernet, Token Ring, and Wireless LAN, and their major schemes such as Spanning Tree Protocol (STP) in IEEE 802.1D.

(5) Develop a software simulator for local area network protocols.

Specification:

For the book problems part of the homework do the following problems out of Tannenbaum: p338-342 #4, 9, 15, 19, 29, 37. Put your solutions in Hw3.pdf . In addition, if you decide to do a Cisco lab, but your lab work in Cisco.pdf. Put these files and all of your coding files into Hw3.zip, which you will submit.

For the programming part of this assignment you will code a simulator for the binary exponential backoff algorithm. You will then use your simulator to perform some experiments of your choice, where you vary the number of stations and or the probability that a station transmits, and write the results of your experiments also in Hw3.pdf. Your program will be run from the command line with a command like:

java BinaryExponentialSimulator number_of_stations number_of_slots probability_station_transmits

number_of_stations should be a positive integer of the number of Station's that will participate in the simulation.

number_of_slots is the total number of slots the simulation should have before stopping

probability_station_transmits is the probability that a Station that was active tries to submit in a give slot.

Given these arguments your simulator then outputs a sequence of slots to the standard output stream which have one of the following formats:

[SEND station_number ] where station_number is the ID of a Station object. This indicates that station_number sent during that slot.

[CONTENTION station_number_list ] where station_number_list is a comma separated list of IDs of Station objects. This indicates that stations in this list all tried to send in the given slot.

[UNUSED] -- this indicates nobody wanted to send.

So for example one might see the sequence:

[UNUSED] [SEND 1] [CONTENTION 3 2] [SEND 2] [SEND 3] ...

Your simulator should keep an array of Station objects. For each slot up to number_of_slots, your simulator calls each stations participate() method. This will return true if that station is going to participate in the given slot and false, otherwise. To determine if the returned value should be true, this method check's the Station's, numberOfSlotsToSkip field. (Your constructor should initialize this to 0). If this is 0 then, the Station object flips a coin with a bias probability_station_transmits and if it comes up participating the method returns true, and, if not, returns false. On the other hand, if numberOfSlotsToSkip is greater than 1, the method decrements numberOfSlotsToSkip and returns false. If the numberOfSlotsToSkip is 1, this value is decremented and the value true is returned. After each Station has had its participate() method called, then the slot is drawn as described above depending on how many chose to participate in the slot. If more than one Station tries to send in a slot, then each contending Station has its contention() method called. This method chooses a random integer according to the exponential backoff algorithm and assigns it appropriately to numberOfSlotsToSkip (there might be a one-off issue given the description above, so you might have to add one). This completes the description of the simulator, except to point out that we will assume that if a Station gets a line we assume what it wants to send can fit entirely in one slot. So it doesn't hold the line for several slots.

Point Breakdown

Book Problems (1pt each) 6pts
Departmental Java Coding Guidelines followed 1pt
Exponential backoff algorithm works correctly 2pts
Write up of your experiments in Hw3.pdf 1pt
Total10pts